package action;

import service.MenuFace;

import com.opensymphony.xwork2.ActionSupport;

public class MenuAction extends ActionSupport
{
	
  private MenuFace menuFace;
  
  private StringBuffer menuStream;
  
  private StringBuffer nextLevelStream;
  
  private int nodeId;
  
  public int getNodeId()
{
	return nodeId;
}

public void setNodeId(int nodeId)
{
	this.nodeId = nodeId;
}

public StringBuffer getNextLevelStream()
{
	return nextLevelStream;
}

public void setNextLevelStream(StringBuffer nextLevelStream)
{
	this.nextLevelStream = nextLevelStream;
}

public StringBuffer getMenuStream()
  {
    return this.menuStream;
  }

  public void setMenuStream(StringBuffer menuStream)
  {
    this.menuStream = menuStream;
  }

  public MenuFace getMenuFace()
{
	return menuFace;
}

public void setMenuFace(MenuFace menuFace)
{
	this.menuFace = menuFace;
}

public String getMenu()
  {
     menuStream = TreeGenerateUtil.treeBuildRoot(menuFace.getLevelOne(), menuFace.getRootNode());
     return "success";
   }

public String getNodes()
{
	nextLevelStream = TreeGenerateUtil.buildNodes(menuFace.getNextLevel(nodeId));
   return "success";
 }
}
